package cn.com.shopec.erp.product.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * @ClassName: Specification
 * @Description: 货品规格实体
 * 
 */
@Entity
@Table(name = "TBL_SPECIFICATION")
public class Specification implements Serializable {
    private static final long serialVersionUID = 7503853302415204223L;
    /** id **/
    private String id;
    /** 规格编号 **/
    private String specNo;
    /** 规格名称 **/
    private String specName;
    /** 分类名称 **/
    private String catNo;
    /** 删除标识（0：已删除，1：未删除） */
    private int deleteFlag;
    /** 创建时间 */
    private String createTime;
    /** 更新时间 */
    private String updateTime;
    /** 规格值的选项 */
    private List<SpecValOption> options;

    @GenericGenerator(name = "generator", strategy = "uuid.hex")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false, length = 32)
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name = "SPEC_NO")
    public String getSpecNo() {
        return this.specNo;
    }

    public void setSpecNo(String specNo) {
        this.specNo = specNo;
    }

    @Column(name = "SPEC_NAME")
    public String getSpecName() {
        return this.specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    @Column(name = "CAT_NO")
    public String getCatNo() {
        return this.catNo;
    }

    public void setCatNo(String catNo) {
        this.catNo = catNo;
    }

    @Column(name = "DELETE_FLAG")
    public int getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(int deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Column(name = "CREATE_TIME")
    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Column(name = "UPDATE_TIME")
    public String getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "SPEC_NO", referencedColumnName = "SPEC_NO", insertable = false, updatable = false)
    public List<SpecValOption> getOptions() {
        return this.options;
    }

    public void setOptions(List<SpecValOption> options) {
        this.options = options;
    }

}
